package com.lfy.domain.dto;

import com.lfy.modules.blog.domain.group.AdminGroup;
import com.lfy.modules.blog.domain.group.WebGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
public class CommentDTO {
    @NotBlank(message = "邮箱不能为空",groups = {WebGroup.class})
    @Email(message = "邮箱格式不正确",groups = {WebGroup.class})
    private String email;
    @NotBlank(message = "姓名不能为空",groups = {WebGroup.class})
    private String name;
    @NotBlank(message = "内容不能为空",groups = {WebGroup.class, AdminGroup.class})
    @Length(min = 1,max = 200, message = "内容长度不能超过200",groups = {WebGroup.class, AdminGroup.class})
    private String content;
    private String toName;
    @Email(message = "邮箱格式不正确",groups = {AdminGroup.class,WebGroup.class})
    private String toEmail;
    @NotNull(message = "父评论ID不能为空",groups = {WebGroup.class, AdminGroup.class})
    private Long parentId;
    @NotNull(message = "是否是作者不能为空",groups = {WebGroup.class, AdminGroup.class})
    private Integer isAuthor;
    @NotNull(message = "文章ID不能为空",groups = {WebGroup.class, AdminGroup.class})
    private Long articleId;
}
